// 导入vue包
import axios from '@/lib/axios'

export function getPromise01(){
	return new Promise(function(){
		axios.post('http://www.liulongbin.top:3006/api/post',{name : 'hahah',gender : '男'})
	})
}

function getProAtFun(res,err){
	return new Promise(function(){
		axios.post('http://www.liulongbin.top:3006/api/post',{name : 'hahah',gender : '男'})
		.then((data)=>{
			console.log('isOK')
			return res(data)
		},(err)=>{
			console.log('isError')
			return err(err)
		})
	})
}

export function getPromise02(){
	getProAtFun(
		(re)=>{
			console.log(re)
			return re.data
		},
		(err)=>{
			console.log(err.message)
			return err.message
		}
	)
}